<?php
$this->title = "Profle - Basic Info";
$this->headTitle($this->title);
?>	

		<!-- start content -->
		<div id="inside" class="content">
			
		<!--  Glavno meni -->
			<div id="InnerMenu">
				<?php $session = Zend_Registry::get('session');?>
				<ul >
					<li style=" display: inline; "><a href="<?php echo $this->url(array('controller'=>'Profile','action'=>'basic'))."?id=". $this->viewuser; ?>">Basic Info</a></li>
					<li style=" display: inline; "><a href="<?php echo $this->url(array('controller'=>'Profile','action'=>'medical'))."?id=". $this->viewuser; ?>">Medical Info</a></li>					
					<li style=" display: inline; "><a href="<?php echo $this->url(array('controller'=>'Profile','action'=>'Interests'))."?id=". $this->viewuser; ?>">Interests</a></li>					
				</ul>
				
			</div>
			<?php 
				$permision = $this->basicInfo_user['ViewPermitions'];
				$flag_view =-1;
				
				switch ($permision) {
					case 0:
				        $flag_view = 1;
				        break;
				    case 1: //only me
				        $flag_view = 2;
				        break;
				    case 2://doktors
				        if ($session->user['UserType'] == 1){
				        	$flag_view = 1;				        	
				        }
				        else{
				        	$flag_view = 0;
				        }				    	
				        break;
				    case 3://firends and doctors
				        $friends_Bo = new Application_Model_DbTable_Friends();
				        $flag_view = $friends_Bo->areFriends($this->viewuser, $session->user['id']);
				        break;
				   case 4://all
				         $flag_view = 1;
				        break;
				}
			?>
				<?php if (($flag_view==1) || (($session->user['id'] == $this->Query) && ($flag_view==2))){?>
				<form id="form_basic_show" name="basic">
					<br/>
					<div id="BasicShow">
						<label for="FirstName"><b>First name: </b><?php echo $this->basicInfo_user['FirstName']; ?></label><br/>
						<label for="LastName"><b>Last name: </b><?php echo $this->basicInfo_user['LastName']; ?></label><br/>
						<label for="Gender"><b>Gender: </b><?php 
														$gender =(int)$this->basicInfo_user['Gender'];
														if ($gender ==1){
															echo "Male";
														}
														else{
															if($gender ==2){
																echo "Female";
															}
															else{
																echo "/";
															}
														}
														 ?></label><br/>
						<label for=Birthday><b>Birthday: </b><?php 
														$birthday = new Zend_Date($this->basicInfo_user['Birthday']);																		
														$birthday=$birthday->toString("dd-MM-YYYY");	
														echo $birthday; ?></label><br/>
						<label for="Education"><b>Education: </b><?php echo $this->basicInfo_user['Education']; ?></label><br/>
						<label for="About"><b>About: </b><?php echo $this->basicInfo_user['About']; ?></label><br/>
						<label for="Country"><b>Country: </b><?php echo $this->basicInfo_user['Country']; ?></label><br/>
						<label for="City"><b>City: </b><?php echo $this->basicInfo_user['City']; ?></label><br/>
					</div>
					
					<div id="div_EditBasic">
							<?php if ($session->user['id'] == $this->Query){?>					
									<a href="<?php echo $this->url(array('controller'=>'Profile','action'=>'basicedit'))."?id=". $this->escape($session->user['id']) ?>">Edit info</a>
							<?php }?>
					</div>
				</form>
				<?php }?>
			
		</div>
		
		<!-- end content -->

		